Skip to content

Conversation

mlfarinha
Copy link
Contributor

Hello! This is my first time making a PR to diffusers so I apologise if I have missed something!

This PR implements the same behaviour from unet_2d_condition.py and unet_3d_condition.py to allow generating images with height/width that are not multiples of 64 while still being multiples of 8 in unet_spatio_temporal_condition.py. To achieve this I changed the forward method of the UNetSpatioTemporalConditionModel upblocks UpBlockSpatioTemporal and CrossAttnUpBlockSpatioTemporal in unet_3d_blocks.py. This PR is related to the closed issue #255


Code to reproduce the error:

import torch

from diffusers import StableVideoDiffusionPipeline
from diffusers.utils import load_image

pipe = StableVideoDiffusionPipeline.from_pretrained(
    "stabilityai/stable-video-diffusion-img2vid-xt", torch_dtype=torch.float16, variant="fp16"
)
pipe.enable_model_cpu_offload()

# Load the conditioning image
image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/rocket.png")
image = image.resize((640, 480))

generator = torch.manual_seed(42)
frames = pipe(image, height=480, width=640, decode_chunk_size=8, generator=generator).frames[0]

Error:

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 16 but got size 15 for tensor number 1 in the list.


@patrickvonplaten and @sayakpaul

@sayakpaul sayakpaul requested review from patil-suraj and DN6 January 20, 2024 02:06
@patrickvonplaten
Copy link
Contributor

@DN6 @patil-suraj can you check here?

@DN6 DN6 self-assigned this Jan 23, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Feb 19, 2024
@sayakpaul
Copy link
Member

@DN6 could you give this a look?

@github-actions github-actions bot removed the stale Issues that haven't received updates label Mar 2, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Mar 27, 2024
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Mar 27, 2024
@DN6
Copy link
Collaborator

DN6 commented Mar 28, 2024

HI @mlfarinha sorry I missed this. PR looks good to me. Could we resolve the conflicts and we can merge.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Apr 21, 2024
@DN6 DN6 removed the stale Issues that haven't received updates label Apr 22, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label May 16, 2024
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label May 16, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Sep 14, 2024
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Sep 17, 2024
@yiyixuxu
Copy link
Collaborator

gentle pin @mlfarinha

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Oct 12, 2024
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@hlky hlky removed the stale Issues that haven't received updates label Dec 12, 2024
@hlky hlky merged commit 6bd30ba into huggingface:main Dec 13, 2024
12 checks passed
sayakpaul pushed a commit that referenced this pull request Dec 23, 2024
…6646)

allow resolutions not multiple of 64 in SVD

Co-authored-by: Miguel Farinha <mignha@CSL15958.local>
Co-authored-by: hlky <hlky@hlky.ac>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants